loadAd

fun loadAd(adRequest: AdRequest, listener: NativeAdLoadListener)

Start loading the native ad on a background thread.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.

listener

NativeAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adRequest: AdRequest): <Error class: unknown class>

Start loading the native ad on a background thread.

Return

NativeAdLoadResult.Success with NativeAd or NativeAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.


fun loadAd(adRequest: AdRequest, options: NativeAdOptions, listener: NativeAdLoadListener)

Start loading the native ad on a background thread.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.

options

Configuration options for native ad loading. Default options load images automatically.

listener

NativeAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adRequest: AdRequest, options: NativeAdOptions): <Error class: unknown class>

Start loading the native ad on a background thread.

Return

NativeAdLoadResult.Success with NativeAd or NativeAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adRequest

an AdRequest object contains targeting information used to fetch a native ad.

options

Configuration options for native ad loading. Default options load images automatically.


fun loadAd(adUnitId: String, readyResponse: String, listener: NativeAdLoadListener)

Start loading the native ad on a background thread with ready response.

Parameters

adUnitId

The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

readyResponse

Encoded response for ad request.

listener

NativeAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adUnitId: String, readyResponse: String): <Error class: unknown class>

Start loading the native ad on a background thread with ready response.

Return

NativeAdLoadResult.Success with NativeAd or NativeAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adUnitId

The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

readyResponse

Encoded response for ad request.


fun loadAd(adUnitId: String, readyResponse: String, options: NativeAdOptions, listener: NativeAdLoadListener)

Start loading the native ad on a background thread with ready response.

Parameters

adUnitId

The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

readyResponse

Encoded response for ad request.

options

Configuration options for native ad loading. Default options load images automatically.

listener

NativeAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adUnitId: String, readyResponse: String, options: NativeAdOptions): <Error class: unknown class>

Start loading the native ad on a background thread with ready response.

Return

NativeAdLoadResult.Success with NativeAd or NativeAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adUnitId

The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

readyResponse

Encoded response for ad request.

options

Configuration options for native ad loading. Default options load images automatically.